<?php
/**
 * 详情管理
 * ============================================================================

 * ============================================================================
 */
defined('BY_JYA') or exit('error');
$op=$_RQ['op']?$_RQ['op']:'get';
$return['ntime']=TIMESTAMP;
cfc('core')->checklogin('jy_jdpm/member.index/');
addmember();
$nickname=pdo_getcolumn('core_members',array('uniacid'=>$_SESSION['uniacid'],'id'=>$_SESSION['uid']),'nickname');
$return['nickname']=$nickname;
if($op=='get'){
	if($_RQ['postdata']){
		
	}
	$pid = intval($_RQ['pid']);
	if(empty($pid)){
		 exi('您没有选择拍品！','error');
	}
	   /** 是否有支付密码 **/
     $Password = pdo_getcolumn('jy_jdpm_member',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']),'paypwd');

	 if(empty($Password)){
		  exi('您还没有设置支付密码，请先设置支付密码','error','jy_jdpm/member.safety/setpay/');
	 }
	 $uid = pdo_getcolumn('jy_jdpm_auction', array('uniacid'=>$_SESSION['uniacid'],'id' => $pid),'mid');
	 if($uid == $_SESSION['uid']){
		  exi('您已经是最高出价者！','error');
	 }
	$return['post'] =array('pid'=>$pid);
	exi($return);
}
if($op=='checkpay'){
	$auctionset=$this->plugin_setting('auction');
	$postdata=get_postdata();
	if(!$postdata['pid']){
		 exi('请选择拍品！','error');
	}
	$uid = $_SESSION['uid'];
	$this->model('auction')->check($postdata['pid']);
	if(!$postdata['agree']){
		 exi('请先阅读：《竞拍服务协议》','error');
	}
	$Password = pdo_getcolumn('jy_jdpm_member',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']),'paypwd');
	if(encryptPwd($postdata['password']) != $Password){
		 exi('支付密码错误！','error');
	}
	$this->model('auction')->biding($postdata['pid']);
}
?>